﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

using Sharp.Infrastructure;
using Sharp.Portal;
using Sharp.Portal.AdminLTE;
using Sharp.Portal.Mvc;
using Sharp.Portal.Mvc.Form;
using Sharp.Portal.Mvc.Models;

namespace Sharp.WebBooter.Areas.Platform.Models
{
    /// <summary>
    /// 工作组
    /// </summary>
    [ItemPage(OpenWith = OpenWith.Window2Column)]
    public partial class GroupModel : ISharpForm
    {
        /// <summary>
        /// 工作组
        /// </summary>
        public GroupModel()
        {
            UI = new BSSharpFrom(this);
        }

        /// <summary>
        /// 主键Id
        /// </summary>
        /// <value>主键Id</value>
        [HiddenInput]
        public int Id { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        [Display(Name = "编码")]
        public string Code { get; set; }
        /// <summary>
        /// 组名
        /// </summary>
        [Display(Name = "组名"), Required]
        public string Title { get; set; }     
        /// <summary>
        /// 归属组织
        /// </summary>
        [Display(Name = "归属组织"), CustomField(FieldType.OrgTreeList)]
        public System.Guid? OrgId { get; set; }

        /// <summary>
        /// OrgId 的数据源
        /// </summary>
        public zTreeNode OrgIdDataSource { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [Display(Name = "备注"), DataType(DataType.MultilineText)]
        public string Remark { get; set; }


        /// <summary>
        /// 父级
        /// </summary>
        public Guid? ParentId
        {
            get;
            set;
        }
        /// <summary>
        /// 排序
        /// </summary>
        public int OrderIndex
        {
            get;
            set;
        }
        public SharpFrom UI  {  get; set ; }
    }
}